/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package elearning.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Sieu
 */
@Entity
@Table(name = "toeic_exercise")
@NamedQueries({
    @NamedQuery(name = "ToeicExercise.findAll", query = "SELECT t FROM ToeicExercise t")})
public class ToeicExercise implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Column(name = "CONTENT")
    private String content;
    @Column(name = "CONTENT_VI")
    private String contentVi;
    @Column(name = "IMG_URL")
    private String imgUrl;
    @Column(name = "AUDIO_URL")
    private String audioUrl;
    @Column(name = "EXPLAIN_CONTENT_VI")
    private String explainContentVi;
    @Column(name = "STATUS")
    @Enumerated(EnumType.ORDINAL)
    private CommonStatus status;
    @Column(name = "CREATED_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdTime;
    @Column(name = "UPDATED_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date updatedTime;
    @JoinColumn(name = "TOEIC_LEVEL_ID", referencedColumnName = "ID")
    @ManyToOne
    private ToeicLevel toeicLevelId;
    @JoinColumn(name = "TOEIC_CATEGORY_ID", referencedColumnName = "ID")
    @ManyToOne
    private ToeicCategory toeicCategoryId;

    public ToeicExercise() {
    }

    public ToeicExercise(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getContentVi() {
        return contentVi;
    }

    public void setContentVi(String contentVi) {
        this.contentVi = contentVi;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getAudioUrl() {
        return audioUrl;
    }

    public void setAudioUrl(String audioUrl) {
        this.audioUrl = audioUrl;
    }

    public String getExplainContentVi() {
        return explainContentVi;
    }

    public void setExplainContentVi(String explainContentVi) {
        this.explainContentVi = explainContentVi;
    }

    public CommonStatus getStatus() {
		return status;
	}

	public void setStatus(CommonStatus status) {
		this.status = status;
	}

	public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(Date updatedTime) {
        this.updatedTime = updatedTime;
    }

    public ToeicLevel getToeicLevelId() {
        return toeicLevelId;
    }

    public void setToeicLevelId(ToeicLevel toeicLevelId) {
        this.toeicLevelId = toeicLevelId;
    }

    public ToeicCategory getToeicCategoryId() {
        return toeicCategoryId;
    }

    public void setToeicCategoryId(ToeicCategory toeicCategoryId) {
        this.toeicCategoryId = toeicCategoryId;
    }


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ToeicExercise)) {
            return false;
        }
        ToeicExercise other = (ToeicExercise) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "elearning.model.ToeicExercise[ id=" + id + " ]";
    }
    
}
